
public class Demo4_1Test {
	public static void main (String[] args ){
		@SuppressWarnings("unused")
		
		Pet p1;
		//new一个对象p1
		p1 = new Pet("Tom","white",2,3.5,1000);//建立一个构造方法来初始化
		//直接给成员变量初始化(一般选择第一种，即建立一个构造方法来初始化)
		//p1.name = "小白";
		//p1.color = "白色";
		//p1.age = 2;
		//p1.weight = 12.0;
		//p1.price = 2000.0;
		p1.showInfo();
		
		Pet p2;
		//再new一个对象p2
		p2 = new Pet("lusy","black",1,2,2000);
		p2.showInfo();
		
	}
}